package site.assad.aspectj.expand;

import org.aspectj.lang.annotation.After;
import org.aspectj.lang.annotation.AfterReturning;
import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;

/**
 * Author: Al-assad 余林颖
 * E-mail: yulinying_1994@outlook.com
 * Date: 2017/12/5 22:25
 * Description: 演示复合切面
 */
@Aspect
public class ComboAspect {
    @Before("execution(* greetTo(..)) && within(site.assad.common.Waiter+)")
        public void beforeGreeting(){
        System.out.println("Hello!");
    }

    @After("execution(* greetTo(..)) && within(site.assad.common.Waiter+)")
    public void afterExecution(){
        System.out.println("Goodbye!");
    }

    @AfterReturning("execution(* greetTo(..)) && target(site.assad.common.Waiter)")
    public void afterGreetig(){
        System.out.println("end!");
    }


}
